﻿<%@ Page Title="模块主表维护" Language="C#" MasterPageFile="~/masterPage/admin/Manage.master"
    AutoEventWireup="true" CodeFile="ManageModule.aspx.cs" Inherits="ManageModule" %>

<%@ MasterType VirtualPath="~/masterPage/admin/Manage.master" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder2" runat="Server">
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="gv_Item1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gv_Item1" />
                    <telerik:AjaxUpdatedControl ControlID="gv_Item2" LoadingPanelID="RadAjaxLoadingPanel1">
                    </telerik:AjaxUpdatedControl>
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div>
        <table width="98%" border="1" cellspacing="0" cellpadding="4" bgcolor="#F4BD97" class="text9pt"
            align="center" style="margin: 0pt 0pt 5pt 0pt; border-color: #f0f0f0">
            <tr align="center" bgcolor="#FF6A04">
                <td class="text9pt" width="60" rowspan="2">
                    <font color="#FFFFFF">显示<br />
                        条件</font>
                </td>
                <td class="text9pt" colspan="3">
                    <font color="#FFFFFF">主模块</font>
                </td>
                <td class="text9pt" width="80">
                    <font color="#FFFFFF">条件设置</font>
                </td>
            </tr>
            <tr align="center">
                <td class="text9pt" align="left">
                    代码：<asp:TextBox ID="tbItem1No" runat="server" Width="28pt" MaxLength="1" class="text9pt"></asp:TextBox>
                </td>
                <td class="text9pt" align="left">
                    名称：<asp:TextBox ID="tbItem1Nm" runat="server" Width="74pt" MaxLength="10" class="text9pt"></asp:TextBox>
                </td>
                <td class="text9pt" align="left">
                    显示：
                    <asp:DropDownList ID="ddlItem1Visible" runat="server">
                        <asp:ListItem Value="-1">全部</asp:ListItem>
                        <asp:ListItem Value="1">显示</asp:ListItem>
                        <asp:ListItem Value="2">隐藏</asp:ListItem>
                        <%--ning --%>
                    </asp:DropDownList>
                </td>
                <td>
                    <asp:Button ID="Btn_Set1" runat="server" Text="搜索" OnClick="Btn_Set1_Click" />
                </td>
            </tr>
        </table>
        <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
            <telerik:RadGrid runat="server" ID="gv_Item1" AllowPaging="True" AllowSorting="True"
                AutoGenerateColumns="False" PageSize="10" Width="97%" ShowStatusBar="True" OnUpdateCommand="gv_Item1_UpdateCommand"
                OnInsertCommand="gv_Item1_InsertCommand" OnDeleteCommand="gv_Item1_DeleteCommand"
                OnItemCommand="gv_Item1_ItemCommand" CssClass="gv_Roles" CellSpacing="0" Culture="ja-JP"
                DataSourceID="sqlDSItem1" GridLines="None" OnItemCreated="gv_Item1_ItemCreated">
                <PagerStyle Mode="NumericPages" AlwaysVisible="true" />
                <MasterTableView Width="100%" CommandItemDisplay="Top" DataSourceID="sqlDSItem1"
                    DataKeyNames="fi_no1" EditMode="PopUp">
                    <NoRecordsTemplate>
                        没有任何主模块的数据！</NoRecordsTemplate>
                    <CommandItemSettings AddNewRecordText="创建主模块" ShowRefreshButton="true" ShowAddNewRecordButton="true"
                        RefreshText="刷新数据"></CommandItemSettings>
                    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="LinkButton">
                            <HeaderStyle Width="4%" />
                        </telerik:GridEditCommandColumn>
                        <telerik:GridTemplateColumn DataField="fi_no1" FilterControlAltText="Filter fi_no1 column"
                            HeaderText="编号" ReadOnly="false" SortExpression="fi_no1" UniqueName="fi_no1">
                            <EditItemTemplate>
                                <telerik:RadTextBox ID="cbFiNo1" runat="server" MaxLength="1" EmptyMessage="请输入主模块编号"
                                    Text='<%# Bind("fi_no1") %>' />
                                <asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" ControlToValidate="cbFiNo1"
                                    ValidationGroup="validateCompanyProduct" ErrorMessage="请输入主模块编号" Display="Dynamic"
                                    SetFocusOnError="true" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblFiNo1" runat="server" Text='<%# Eval("fi_no1") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="fi_sort1" FilterControlAltText="Filter fi_sort1 column"
                            HeaderText="排序" ReadOnly="false" SortExpression="fi_sort1" UniqueName="fi_sort1">
                            <EditItemTemplate>
                                <%--<telerik:RadTextBox ID="cbFiSort1"  runat="server" MaxLength="3" 
                               EmptyMessage="请输入主模块排序"  Text='<%# Bind("fi_sort1") %>' />
                               <asp:RequiredFieldValidator ID="Requiredfieldvalidator2" runat="server" ControlToValidate="cbFiSort1"
                             ValidationGroup="validateCompanyProduct" ErrorMessage="请输入主模块排序" Display="Dynamic" SetFocusOnError="true" />--%>
                                <%-- cbFiSort1  <%-- nint start ,限制输入只能为数字且最大数为255--%>
                                <telerik:RadNumericTextBox ID="cbFiSort1" MaxLength="3" runat="server" ToolTip="最大数值为255"
                                    Value="0" Type="Number" NumberFormat-KeepNotRoundedValue="true" NumberFormat-AllowRounding="false"
                                    NumberFormat-DecimalDigits="0">
                                </telerik:RadNumericTextBox>
                                <asp:RequiredFieldValidator ID="NumercTextBoxRequiredFieldValidator" runat="server"
                                    Display="Dynamic" ControlToValidate="cbFiSort1" ErrorMessage="请输入排序" />
                                <asp:RangeValidator ID="NumericTextBoxRangeValidator" runat="server" ControlToValidate="cbFiSort1"
                                    ErrorMessage="数值不得超出255" Display="Dynamic" MaximumValue="255" MinimumValue="0"
                                    Type="Double" />
                                <%-- nint end--%>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblFiSort1" runat="server" Text='<%# Eval("fi_sort1") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="fi_name1" FilterControlAltText="Filter fi_name1 column"
                            HeaderText="主模块名称" SortExpression="fi_name1" UniqueName="fi_name1">
                            <EditItemTemplate>
                                <telerik:RadTextBox ID="cbFiName1" runat="server" MaxLength="10" EmptyMessage="请输入主模块名称"
                                    Text='<%# Bind("fi_name1") %>' />
                                <asp:RequiredFieldValidator ID="Requiredfieldvalidator3" runat="server" ControlToValidate="cbFiName1"
                                    ValidationGroup="validateCompanyProduct" ErrorMessage="请输入主模块名称" Display="Dynamic"
                                    SetFocusOnError="true" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbFiName1" runat="server" Text='<%# Eval("fi_name1") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridDropDownColumn DataSourceID="xdsMoudleShow" DataField="is_visible" DataType="System.Byte"
                            FilterControlAltText="Filter is_visible column" HeaderText="是否显示" SortExpression="is_visible"
                            UniqueName="is_visible" ListTextField="Name" ListValueField="Value" DropDownControlType="RadComboBox">
                        </telerik:GridDropDownColumn>
                        <telerik:GridButtonColumn Text="删除" CommandName="Delete" ButtonType="ImageButton"
                            ConfirmTitle="确认删除" ConfirmText="确认您要删除该主模块吗？">
                            <HeaderStyle Width="2%" />
                        </telerik:GridButtonColumn>
                        <telerik:GridButtonColumn ButtonType="PushButton" CommandName="refItem2" Text="查询子模块"
                            ConfirmDialogHeight="100" ConfirmDialogWidth="100" ConfirmDialogType="Classic">
                        </telerik:GridButtonColumn>
                    </Columns>
                    <EditFormSettings>
                        <EditColumn ButtonType="ImageButton" CancelText="取消" InsertText="新建" />
                    </EditFormSettings>
                    <PagerStyle AlwaysVisible="False"></PagerStyle>
                </MasterTableView>
                <ClientSettings EnableRowHoverStyle="true">
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
                <ValidationSettings ValidationGroup="validateCompanyProduct" />
            </telerik:RadGrid>
        </telerik:RadAjaxPanel>
        <table width="98%" border="1" cellspacing="0" cellpadding="4" bgcolor="#F4BD97" class="text9pt"
            align="center" style="margin: 0pt 0pt 5pt 0pt; border-color: #f0f0f0">
            <tr align="center" bgcolor="#FF6A04">
                <td class="text9pt" width="60" rowspan="2">
                    <font color="#FFFFFF">显示<br />
                        条件</font>
                </td>
                <td class="text9pt" colspan="3">
                    <font color="#FFFFFF">子模块</font>
                </td>
                <td class="text9pt" width="80">
                    <font color="#FFFFFF">条件设置</font>
                </td>
            </tr>
            <tr align="center">
                <td class="text9pt" align="left" style="width: 147px">
                    代码：<asp:TextBox ID="tbItem2No" runat="server" Width="30pt" MaxLength="4" class="text9pt"></asp:TextBox>
                </td>
                <td class="text9pt" align="left">
                    名称：<asp:TextBox ID="tbItem2Nm" runat="server" Width="65pt" MaxLength="10" class="text9pt"></asp:TextBox>
                </td>
                <td class="text9pt" align="left">
                    显示：
                    <asp:DropDownList ID="ddlItem2Visible" runat="server">
                        <asp:ListItem Value="-1">全部</asp:ListItem>
                        <asp:ListItem Value="1">显示</asp:ListItem>
                        <asp:ListItem Value="2">隐藏</asp:ListItem>
                    </asp:DropDownList>
                </td>
                <td>
                    <asp:Button ID="Btn_Set2" runat="server" Text="搜索" OnClick="Btn_Set2_Click" />
                </td>
            </tr>
        </table>
        <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
            <telerik:RadGrid runat="server" ID="gv_Item2" AllowPaging="True" AllowSorting="True"
                AutoGenerateColumns="False" PageSize="10" Width="97%" ShowStatusBar="True" OnUpdateCommand="gv_Item2_UpdateCommand"
                OnInsertCommand="gv_Item2_InsertCommand" OnDeleteCommand="gv_Item2_DeleteCommand"
                OnItemCommand="gv_Item2_ItemCommand" CssClass="gv_Roles" CellSpacing="0" Culture="ja-JP"
                DataSourceID="sqlDSItem2" GridLines="None" OnItemCreated="gv_Item2_ItemCreated">
                <PagerStyle Mode="NumericPages" AlwaysVisible="true" />
                <MasterTableView Width="100%" CommandItemDisplay="Top" DataSourceID="sqlDSItem2"
                    DataKeyNames="fi_no2" EditMode="PopUp">
                    <NoRecordsTemplate>
                        没有任何子模块的数据！</NoRecordsTemplate>
                    <CommandItemSettings AddNewRecordText="创建子模块" ShowRefreshButton="true" ShowAddNewRecordButton="true"
                        RefreshText="刷新数据"></CommandItemSettings>
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="LinkButton">
                            <HeaderStyle Width="4%" />
                        </telerik:GridEditCommandColumn>
                        <telerik:GridTemplateColumn DataField="fi_no2" FilterControlAltText="Filter fi_no2 column"
                            HeaderText="编号" ReadOnly="false" SortExpression="fi_no2" UniqueName="fi_no2">
                            <EditItemTemplate>
                                <telerik:RadTextBox ID="cbFiNo2" runat="server" MaxLength="4" EmptyMessage="请输入子模块编号"
                                    Text='<%# Bind("fi_no2") %>' />
                                <asp:RequiredFieldValidator ID="Requiredfieldvalidator1" runat="server" ControlToValidate="cbFiNo2"
                                    ValidationGroup="validateCompanyProduct" ErrorMessage="请输入子模块编号" Display="Dynamic"
                                    SetFocusOnError="true" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblFiNo2" runat="server" Text='<%# Eval("fi_no2") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="fi_sort2" FilterControlAltText="Filter fi_sort2 column"
                            HeaderText="排序" ReadOnly="false" SortExpression="fi_sort2" UniqueName="fi_sort2">
                            <EditItemTemplate>
                                <%--<telerik:RadTextBox ID="cbFiSort2"  runat="server" MaxLength="3" 
                               EmptyMessage="请输入子模块排序"  Text='<%# Bind("fi_sort2") %>' />
                               <asp:RequiredFieldValidator ID="Requiredfieldvalidator2" runat="server" ControlToValidate="cbFiSort2"
                             ValidationGroup="validateCompanyProduct" ErrorMessage="请输入子模块排序" Display="Dynamic" SetFocusOnError="true" />--%>
                                <%-- nint start ,限制输入只能为数字且最大数为255--%>
                                <telerik:RadNumericTextBox ID="cbFiSort2" MaxLength="3" runat="server" ToolTip="最大数值为255"
                                    Value="0" Type="Number" NumberFormat-KeepNotRoundedValue="true" NumberFormat-AllowRounding="false"
                                    NumberFormat-DecimalDigits="0">
                                </telerik:RadNumericTextBox>
                                <asp:RequiredFieldValidator ID="NumercTextBoxRequiredFieldValidator" runat="server"
                                    Display="Dynamic" ControlToValidate="cbFiSort2" ErrorMessage="请输入排序" />
                                <asp:RangeValidator ID="NumericTextBoxRangeValidator" runat="server" ControlToValidate="cbFiSort2"
                                    ErrorMessage="数值不得超出255" Display="Dynamic" MaximumValue="255" MinimumValue="0"
                                    Type="Double" />
                                <%-- nint end--%>
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lblFiSort2" runat="server" Text='<%# Eval("fi_sort2") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="fi_name2" FilterControlAltText="Filter fi_name2 column"
                            HeaderText="子模块名称" SortExpression="fi_name2" UniqueName="fi_name2">
                            <EditItemTemplate>
                                <telerik:RadTextBox ID="cbFiName2" runat="server" MaxLength="20" EmptyMessage="请输入子模块名称"
                                    Text='<%# Bind("fi_name2") %>' />
                                <asp:RequiredFieldValidator ID="Requiredfieldvalidator3" runat="server" ControlToValidate="cbFiName2"
                                    ValidationGroup="validateCompanyProduct" ErrorMessage="请输入子模块名称" Display="Dynamic"
                                    SetFocusOnError="true" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbFiName2" runat="server" Text='<%# Eval("fi_name2") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn DataField="fi_url2" FilterControlAltText="Filter fi_url2 column"
                            HeaderText="子模块APPID" SortExpression="fi_url2" UniqueName="fi_url2">
                            <EditItemTemplate>
                                <telerik:RadTextBox ID="cbFiUrl2" runat="server" MaxLength="20" EmptyMessage="请输入子模块名称"
                                    Text='<%# Bind("fi_url2") %>' />
                                <asp:RequiredFieldValidator ID="Requiredfieldvalidator4" runat="server" ControlToValidate="cbFiUrl2"
                                    ValidationGroup="validateCompanyProduct" ErrorMessage="请输入子模块名称" Display="Dynamic"
                                    SetFocusOnError="true" />
                            </EditItemTemplate>
                            <ItemTemplate>
                                <asp:Label ID="lbFiUrl2" runat="server" Text='<%# Eval("fi_url2") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridDropDownColumn DataSourceID="xdsMoudleShow" DataField="is_visible" DataType="System.Byte"
                            FilterControlAltText="Filter is_visible column" HeaderText="是否显示" SortExpression="is_visible"
                            UniqueName="is_visible" ListTextField="Name" ListValueField="Value" DropDownControlType="RadComboBox">
                        </telerik:GridDropDownColumn>
                        <telerik:GridButtonColumn Text="删除" CommandName="Delete" ButtonType="ImageButton"
                            ConfirmTitle="确认删除" ConfirmText="确认您要删除该子模块吗？">
                            <HeaderStyle Width="2%" />
                        </telerik:GridButtonColumn>
                    </Columns>
                    <EditFormSettings>
                        <EditColumn ButtonType="ImageButton" CancelText="取消" InsertText="新建" />
                    </EditFormSettings>
                    <PagerStyle AlwaysVisible="False"></PagerStyle>
                </MasterTableView>
                <ValidationSettings ValidationGroup="validateCompanyProduct" />
            </telerik:RadGrid>
        </telerik:RadAjaxPanel>
    </div>
    <asp:XmlDataSource ID="xdsMoudleShow" runat="server" DataFile="~/App_Data/XML/ModuleShow.xml">
    </asp:XmlDataSource>
    <asp:SqlDataSource ID="sqlDSItem1" runat="server" ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>"
        SelectCommand="SELECT [fi_no1],[fi_sort1], [fi_name1], [is_visible] FROM [Func_Item1] WHERE (([fi_name1] LIKE '%' + @fi_name1 + '%') AND ([fi_no1] &gt;= @fi_no1L) AND ([fi_no1] &lt;= @fi_no1R) AND ([is_visible] = @is_visibleL OR [is_visible] = @is_visibleR)) ORDER BY [fi_sort1]">
        <SelectParameters>
            <asp:Parameter DefaultValue="%" Name="fi_name1" Type="String" />
            <asp:Parameter DefaultValue="0" Name="fi_no1L" Type="String" />
            <asp:Parameter DefaultValue="Z" Name="fi_no1R" Type="String" />
            <asp:Parameter DefaultValue="1" Name="is_visibleL" Type="Byte" />
            <asp:Parameter DefaultValue="2" Name="is_visibleR" Type="Byte" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="sqlDSItem2" runat="server" ConnectionString="<%$ ConnectionStrings:XunPanConnectionString %>"
        SelectCommand="SELECT [fi_no2],[fi_sort2], [fi_name2],[fi_url2], [is_visible] FROM [Func_Item2] WHERE (([fi_no1]=@fi_no1) AND ([fi_name2] LIKE '%' + @fi_name2 + '%') AND ([fi_no2] &gt;= @fi_no2L) AND ([fi_no2] &lt;= @fi_no2R) AND ([is_visible] = @is_visibleL OR [is_visible] = @is_visibleR)) ORDER BY [fi_sort2]">
        <SelectParameters>
            <asp:ControlParameter ControlID="ltlItem1" Name="fi_no1" Type="String" PropertyName="Text" />
            <asp:Parameter DefaultValue="%" Name="fi_name2" Type="String" />
            <asp:Parameter DefaultValue="0" Name="fi_no2L" Type="String" />
            <asp:Parameter DefaultValue="Z" Name="fi_no2R" Type="String" />
            <%-- 编号接受数字和字母 --%>
            <asp:Parameter DefaultValue="1" Name="is_visibleL" Type="Byte" />
            <asp:Parameter DefaultValue="2" Name="is_visibleR" Type="Byte" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:Literal ID="ltlItem1" runat="server" Visible="False"></asp:Literal>
</asp:Content>
